package com.delivery.deliverysystem.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.delivery.deliverysystem.pojo.DO.SystemLog;
import com.delivery.deliverysystem.service.SystemLogService;
import com.delivery.deliverysystem.dao.SystemLogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author Administrator
 * @description 针对表【system_log(系统日志记录表)】的数据库操作Service实现
 * @createDate 2025-01-13 15:37:40
 */
@Service
@Slf4j
public class SystemLogServiceImpl extends ServiceImpl<SystemLogMapper, SystemLog>
        implements SystemLogService {

    @Autowired
    private SystemLogMapper systemLogMapper;

    /**
     * 分页查询日志
     * @param pageNum  当前页，从1开始
     * @param pageSize 每页条数
     * @return 分页结果
     */
    @Override
    public IPage<SystemLog> getLogList(long pageNum, long pageSize) {
        Page<SystemLog> page = new Page<>(pageNum, pageSize);
        return systemLogMapper.selectPage(page, null);
    }

}
